{include file="public/header"}
<head>
    <meta charset="utf-8">
    <meta name="viewport"
          content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,initial-scale=1.0,width=device-width"/>
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>任务管理</title>
    <link rel="stylesheet" type="text/css" href="__CSS__/tt.css"/>
    <!--<link rel="stylesheet" href="__JS__/webuploader/webuploader.css" >&lt;!&ndash;webUploader上传组件&ndash;&gt;-->
    <!--<link rel="stylesheet" href="__JS__/webuploader/style.css" >&lt;!&ndash;webUploader上传组件&ndash;&gt;-->
    <link href="/static/admin/css/font-awesome.min.css?v=4.7.0" rel="stylesheet">
    <link href="__JSS__/plugins/layui/css/layui.css" rel="stylesheet">
    <style type="text/css">

        html body {
            margin: 0;
            background-color: #EEEEEE;
            width: 100%;
            height: 100%;
            font-size: 14px;
            color: #333333;
            font-weight: 500;
        }

        .flex-wrap {
            display: -webkit-box;
            display: box;
            display: -webkit-flex;
            display: flex;
        }

        .flex-con {
            -webkit-box-flex: 1;
            -webkit-flex: 1;
            flex: 1;
        }

        .flex-vertical {
            -webkit-box-horizontal: vertical;
            -webkit-flex-flow: column;
            flex-flow: column;
        }

        .wrap1 {
            width: 100%;
            background: #3F3F3F;
            height: 30px;
            line-height: 30px;
        }

        .wrap1 .content1 {
            margin: 0 auto;
            width: 1200px;
            font-size: 12px;
            color: #ffffff;
            /*position: relative;*/
            display: -webkit-box;
            display: box;
            display: -webkit-flex;
            display: flex;
        }

        .kong {
            -webkit-box-flex: 1;
            -webkit-flex: 1;
            flex: 1;
        }

        .content12 {
            position: relative;
        }

        .redhot {
            width: 6px;
            height: 6px;
            border-radius: 50%;
            background: #BA0000;
            position: absolute;
            left: 24px;
            top: 5px;
        }

        .wrap2 {
            line-height: 60px;
            width: 100%;
            height: 60px;
            background: #ffffff;
        }

        .content2 {
            margin: auto;
            width: 1200px;
            display: -webkit-box;
            display: box;
            display: -webkit-flex;
            display: flex;
        }

        .content2_left {
            width: 190px;
            font-size: 18px;
            color: #333333;
        }

        .content2_left span {
            display: inline-block;
            width: 36px;
            height: 36px;
            border-radius: 50%;
            background: #0065F0;
            vertical-align: middle;
            margin-right: 11px;
        }

        .content_middle {
            -webkit-box-flex: 1;
            -webkit-flex: 1;
            flex: 1;
            text-align: left;
            display: -webkit-box;
            display: box;
            display: -webkit-flex;
            display: flex;

        }

        .content_right {
            font-size: 16px;
        }

        .content_right img {
            display: inline-block;
            width: 36px;
            height: 36px;
            border-radius: 50%;
            margin-right: 20px;
            vertical-align: middle;
        }

        .content_middle .item {
            width: 152px;
        }

        .content_middle .item.active2 {
            color: #0065F0;
        }

        .wrap3 {
            line-height: 60px;
            width: 100%;
            height: 60px;
            background: #0065F0;
        }

        .content3 {
            margin: auto;
            width: 1200px;
            display: -webkit-box;
            display: box;
            display: -webkit-flex;
            display: flex;
        }

        .content3-left {
            line-height: 60px;
            color: #ffffff;
            font-size: 16px;
        }

        .wrap4 {
            background: #EEEEEE;
            width: 100%;
            padding-top: 30px;
            padding-bottom: 80px;

        }

        .content4 {
            margin: auto;
            width: 1200px;
            /*display: flex;*/
            background: #ffffff;
            padding-top: 50px;
            /*padding-bottom: 40px;*/
        }

        .item4 {
            display: -webkit-box;
            display: box;
            display: -webkit-flex;
            display: flex;
            height: 34px;
            line-height: 34px;
            font-size: 14px;
            margin-bottom: 30px;
        }

        .item4_left {
            width: 184px;
            text-align: right;
            margin-right: 30px;
        }

        .erqifen .item4_left {
            width: 120px;
        }
        .erqifen .item4 {
            margin-bottom: 10px;
        }
        .item4_middle {
            -webkit-box-flex: 1;
            -webkit-flex: 1;
            flex: 1;
            position: relative;
            display: -webkit-box;
            display: box;
            display: -webkit-flex;
            display: flex;
        }

        select {
            margin-right: 20px;
            /*flex:1;*/
            width: 160px;
            outline: none;
        }

        option {
            width: 160px;
            height: 34px;
        }

        .inputrenwu {
            padding-left: 11px;
            box-sizing: border-box;
            display: inline-block !important;
            width: 520px;
            height: 34px !important;
            line-height: 34px !important;
            border: 1px solid #CCCCCC !important;
            border-radius: 3px;
            outline: none;
        }

        .item4_middle .upload {
            width: 72px;
            height: 34px;
            padding-left: 40px;
            line-height: 34px;
            border: 1px solid #CCCCCC;
            border-radius: 3px;
            margin-right: 60px;
            color: #CCCCCC;
            position: relative;
        }

        .shangchuan {
            position: absolute;
            left: 15px;
            top: 9px;
            width: 16px;
            height: 16px;
            display: block;
        }

        .item4_middle .upload2 {
            width: 82px;
            height: 34px;
            background: #0065F0;
            line-height: 34px;
            border-radius: 3px;
            padding-right: 15px;
            padding-left: 15px;
            padding-right: 15px:
            margin-right: 60px;
            color: #ffffff;
        }

        .item4_middle .upload img {
            vertical-align: middle;
            display: inline-block;
            width: 16px;
            height: 16px;
            margin-right: 10px;
        }

        .item4_middle .text {
            position: absolute;
            left: 0px;
            top: 42px;
            font-size: 12px;
            color: #CCCCCC;
            line-height: 12px
        }

        .ellipsi1 {
            overflow: hidden;
            white-space: nowrap;
            text-overflow: ellipsis;
        }

        .lable {
            width: 110px;
        }

        .lable .span1,.lable .span11 {
            display: inline-block;
            width: 14px;
            height: 14px;
            vertical-align: middle;
            margin-right: 11px;
            border: 1px solid #D9D9D9;
            border-radius: 50%;
        }

        .lable .span2 {
            display: inline-block;
            width: 14px;
            height: 14px;
            vertical-align: middle;
            margin-right: 11px;
            border: 1px solid #0065F0;
            border-radius: 50%;
            background-size: 100% 100%;
            background: url(__IMG__/yuanhuan1.png) no-repeat center center;
        }

        .radioched,.radioched2 {
            display: inline-block;
            width: 14px;
            height: 14px;
            vertical-align: middle;
            margin-right: 11px;
        }

        .span2 img {
            width: 14px;
            height: 14px;
        }

        .hidden {
            display: none !important;
        }

        .danwei {
            font-size: 14px;
            color: #333333;
            margin-left: 10px;
        }

        .item4_middle .add {
            width: 102px;
            height: 102px;
            margin-right: 60px;
            position: relative;
        }

        .delete {
            position: absolute;
            bottom: 0;
            width: 100%;
            left: 0;
            height: 24px;
            line-height: 24px;
            text-align: center;
            background: rgba(0, 0, 0, 0.3);
            color: #ffffff;
            font-size: 12px;
        }

        .add img {
            width: 100%;
            height: 100%;
        }

        .startime {
            /*width: 160px;*/
            height: 34px;
            border: 1px solid #CCCCCC;
            border-radius: 3px;
            padding: 0 10px;
            box-sizing: border-box;
            margin-right: 10px;
            color: #333333;
            display: flex;
            position: relative;

            display: -webkit-box;
            display: box;
            display: -webkit-flex;
            display: flex;
        }

        .startime_text {
        }

        .startime_middle {
            flex: 1;
            -webkit-box-flex: 1;
            -webkit-flex: 1;
            flex: 1;

        }

        .jianjie {
            width: 520px;
            /*height: 270px;*/
            height: auto;
            padding: 20px;
            box-sizing: border-box;
            background: rgba(255, 255, 255, 1);
            border-radius: 3px;
            border: 1px solid rgba(204, 204, 204, 1);
        }

        .jianjie img {
            display: block;
            width: 100px;
            height: 100px;
            margin-bottom: 16px;
        }

        .jianjie p {
            font-size: 12px;
            line-height: 18px;
            color: #666666;
        }

        .select {
            margin-right: 20px;
            width: 160px;
            height: 34px;
            border-radius: 3px;
            border: 1px solid #cccccc;
            display: flex;
            padding-left: 10px;
            box-sizing: border-box;
            line-height: 34px;
            color: #666666;
            font-size: 12px;
            position: relative;
        }

        .everyoption {
            text-indent: 10px;
            height: 32px;
            line-height: 32px;
            font-size: 12px;
            color: #999999;
        }

        .everyoption:hover {
            background: #0065F0;
            color: #ffffff;

        }

        .alloption {
            display: none;
            background: #ffffff !important;
            z-index: 999;
            padding-left: 0px;

            box-sizing: border-box;
            position: absolute;
            left: 0;
            top: 36px;
            border: 1px solid #eeeeee;
            height: auto;
            box-shadow: 0px 0px 6px 0px rgba(0, 101, 240, 0.6);
            width: 160px;
            overflow-y: scroll;
            max-height: 256px;
        }

        .select .option {
            flex: 1;
            -webkit-box-flex: 1;
            -webkit-flex: 1;
            flex: 1;

        }

        .sanjiao_wrap {
            border-left: 1px solid #cccccc;

            width: 32px;
            height: 32px;
            position: absolute;
            right: 0px;
            top: 0px;
        }

        .sanjiao2 {

            display: block;
            position: absolute;
            left: 50%;
            top: 50%;
            width: 32px;
            height: 32px;
            transform: translate(-50%, -50%);

            -ms-transform: translate(-50%, -50%);
            -moz-transform: translate(-50%, -50%);
            -webkit-transform: translate(-50%, -50%);
            -o-transform: translate(-50%, -50%);
        }

        .sanjiao1 {
            position: absolute;
            left: 50%;
            top: 50%;
            width: 32px;
            height: 32px;
            transform: translate(-50%, -50%) rotate(180deg);

            -ms-transform: translate(-50%, -50%) rotate(180deg);
            -moz-transform: translate(-50%, -50%) rotate(180deg);
            -webkit-transform: translate(-50%, -50%) rotate(180deg);
            -o-transform: translate(-50%, -50%) rotate(180deg);
        }

        * {
            cursor: pointer;
        }

        .btn1 {
            width: 130px;
            height: 34px;
            background: #0065F0;
            color: #ffffff;
            line-height: 34px;
            text-align: center;
            margin-right: 35px;
            font-size: 12px;

        }

        .btn2 {
            font-size: 12px;
            width: 130px;
            height: 34px;
            background: #F7F7F7;
            color: #D9D9D9;
            line-height: 34px;
            text-align: center;
            margin-right: 35px;
        }
    </style>
    <style>
        .selecttttName1 {
            background: #0065F0;
            color: #ffffff;
        }
        .w-e-text-container{
            height: 300px !important;/*!important是重点，因为原div是行内样式设置的高度500px*/
        }
    </style>
</head>

<body>
<div class="wrap3">
    <div class="content3">
        <div class="content3-left">
            任务管理 > 发布
        </div>
    </div>
</div>
<div class="wrap4">
    <!--<form id="fabutask" action="/shop/Task/test" method="post" enctype="multipart/form-data">-->
    <form id="fabutask">
        <div class="content4">
            <div class="item4">
                <div class="item4_left">
                    任务类型
                </div>
                <div class="item4_middle">
                    <div class="select">
                        <div class="option task_type">{$tasktype[$data['task_type']]}</div>
                        <div class="sanjiao_wrap">
                            <img class="sanjiao2" src="__IMG__/select.png" id="sanjiao1">
                        </div>
                    </div>
                </div>
            </div>
            <div class="item4">
                <div class="item4_left">
                    普通/活动任务
                </div>
                <div class="item4_middle">
                    <div class="select">
                        <div class="option task_type">{if $data['task_active'] == 1}普通任务{else /}活动任务{/if}</div>
                        <div class="sanjiao_wrap">
                            <img class="sanjiao2" src="__IMG__/select.png">
                        </div>
                    </div>
                </div>
            </div>
            {if $data.task_type != 5}
            <div class="item4 task_href">
                <div class="item4_left xiazai">
                    任务链接
                </div>
                <div class="item4_middle">
                    <input class="inputrenwu" name="task_href" type="text" value="{$data.task_href}">
                </div>
            </div>
            {/if}
            <!--下载时要填写的：多了仨 start -->
            {if $data.task_type == 1}
            <div class="item4 task_href_ios">
                <div class="item4_left">
                    ios下载链接
                </div>
                <div class="item4_middle">
                    <input class="inputrenwu" name="task_href_ios" type="text" value="{$data.task_href_ios}">
                </div>
            </div>
            <div class="item4 task_app_ios">
                <div class="item4_left">
                    ios包名
                </div>
                <div class="item4_middle">
                    <input class="inputrenwu" name="task_app_ios" type="text" value="{$data.task_app_ios}">
                </div>
            </div>
            <div class="item4 task_app_android">
                <div class="item4_left">
                    安卓包名
                </div>
                <div class="item4_middle">
                    <input class="inputrenwu" name="task_app_android" type="text" value="{$data.task_app_android}">
                </div>
            </div>
            {/if}
            <!--下载时要填写的：多了仨 end -->
            {if $data.task_type == 5}
            <div class="item4 input_video" style="height: 100px;">
                <div class="item4_left">
                    上传视频
                </div>
                <div class="item4_middle">
                    <div class="upload">
                        <img src="__IMG__/upload1.png" alt="" class="shangchuan"/> 上传视频
                    </div>
                    <input type="file" accept="video/mp4" id="file" onChange="preview(this)" style="display:none;"
                           name="input_video">
                    <div class="text havevideo">注：请上传15s以上的视频
                    </div>
                    <video id="showvideo" height="100" width="300" src="{$data.task_href}" controls="controls">
                        您的浏览器不支持 video 标签。
                    </video>
                </div>

            </div>
            {/if}
            {if $data.task_type == 6}
            <div class="item4 task_share_type" style="padding-top:15px;">
                <div class="item4_left">
                    分享类型
                </div>
                <div class="item4_middle">
                    <div class="lable">
                        <span class="span1 {if $data.task_share_type==1}hidden{/if}"></span>
                        <img src="__IMG__/radio.png" class="radioched {if $data.task_share_type==2}hidden{/if}"> 曝光率

                    </div>
                    <div class="lable">
                        <img src="__IMG__/radio.png" class="radioched {if $data.task_share_type==1}hidden{/if}">
                        <span class="span1 {if $data.task_share_type==2}hidden{/if}"></span> 到达率
                    </div>
                    <div class="text">注：曝光率是分享次数，到达率是分享出去的
                    </div>
                </div>
            </div>
            <!--曝光率和到达率的二期新增 start-->
                <!--是否需要审核-->
            {if $data.task_share_type != 2 || $data.task_share_d_fen != 2}
                <div class="item4">
                    <div class="item4_left">
                        是否上传图
                    </div>
                    <div class="item4_middle">
                        <div class="lable">
                            <input type="radio" name="task_share_submit" value="1" {if $data.task_share_submit == 1}checked{/if}> 是
                        </div>
                        <div class="lable">
                            <input type="radio" name="task_share_submit" value="2" {if $data.task_share_submit == 2}checked{/if}> 否
                        </div>
                        <div class="text">注：不上传图则自动审核
                        </div>
                    </div>
                </div>
            {/if}
                <!--曝光率：要分享几次-->
                {if $data.task_share_type == 1}
                <div class="item4 bao_g" style="padding-top:15px;">
                    <div class="item4_left">
                        分享次数
                    </div>
                    <div class="item4_middle">
                        <input class="inputrenwu" name="task_share_b_num" id="task_share_b_num" type="text" oninput = "handleMoney(this,0);" value="{$data.task_share_b_num}">
                    </div>
                </div>
                {else /}
                    <!--到达率：默认不分步骤1 -->
                    <div class="item4 dao_d">
                        <div class="item4_left">
                            是否分步骤
                        </div>
                        <div class="lable">
                            <input type="radio" name="task_share_d_fen" value="1" {if $data.task_share_d_fen == 1}checked{else /}disabled{/if}> 不分
                        </div>
                        <div class="lable">
                            <input type="radio" name="task_share_d_fen" value="2" {if $data.task_share_d_fen == 2}checked{else /}disabled{/if}> 分
                        </div>
                    </div>
                    {if $data.task_share_d_fen == 2}
                    <div class="item4">
                        <div class="item4_left">
                            每步完成时间
                        </div>
                        <div class="item4_middle">
                            <input class="inputrenwu" name="task_share_timeout" value="{$data.task_share_timeout}" id="task_share_timeout" type="text" oninput = "handleMoney(this,0);" style="width:160px;">
                            <div class="danwei">/小时
                            </div>
                        </div>
                    </div>
            <!---->
            <!--到达率的二期新增 start-->
            <!--到达率的二期新增 start-->
            <!--到达率的二期新增 start-->
            <div style="width: 184px;text-align: right;margin-right: 30px;float: left;">步骤</div>
            <div class="erqifen" style="width:600px;margin:-10px 20px 20px 0;padding-top:20px;border: 1px solid #CCC;float: left;">
                {volist name='up_task_fen' id='tf'}
                <div class="five" id="five_{$tf.tf_order}">
                    <div class="item4">
                        <div class="item4_left">
                            第 {++$key} 步描述
                        </div>
                        <div class="item4_middle">
                            <input class="inputrenwu" value="{$tf.tf_desc}" {if $tf.tf_order != $max}disabled{/if} maxlength="15" name="tf_desc" type="text" placeholder="步骤简短描述（15个字）" style="width: 300px;">
                            <div onclick="shanchu(this);" class="five_{$tf.tf_order}" style="margin-left: 100px;margin-top: -15px;border: 1px solid red;padding: 2px;height: 20px;line-height: 20px;border-radius: 2px;color: red;">删除</div>
                        </div>
                    </div>
                    <!--是否需要审核-->
                    <div class="item4">
                        <div class="item4_left">
                            是否上传图
                        </div>
                        {if $tf.tf_order != $max}
                        <div class="item4_middle">
                            <div class="lable">
                                <span {if $tf.tf_submit == 1}style="color: blue;"{/if}>是</span>
                            </div>
                            <div class="lable">
                                <span {if $tf.tf_submit == 2}style="color: blue;"{/if}>否</span>
                            </div>
                        </div>
                        {else /}
                        <div class="item4_middle">
                            <div class="lable">
                                <input type="radio" {if $tf.tf_submit == 1}checked{/if} name="tf_submit" value="1"> <span>是</span>
                            </div>
                            <div class="lable">
                                <input type="radio" {if $tf.tf_submit == 2}checked{/if} name="tf_submit" value="2"> <span>否</span>
                            </div>
                        </div>
                        {/if}

                    </div>
                    <!--当前步骤任务金额-->
                    <div class="item4">
                        <div class="item4_left">
                            当前步骤任务金额
                        </div>
                        <div class="item4_middle">
                            <input class="inputrenwu" name="tf_money" value="{$tf.tf_money}" {if $tf.tf_order != $max}disabled{/if} id="tf_money" type="text" oninput = "handleMoney(this,1);" placeholder="最多保留一位小数" style="width:160px;">
                            <div class="danwei">/平台币

                            </div>
                            <div class="text">注：1元=10平台币
                            </div>

                        </div>
                    </div>
                    <!--分享途径选择 start -->
                    <div class="item4" style="padding-top: 15px;margin-bottom: 20px;">
                        <div class="item4_left">
                            分享渠道
                        </div>
                        {if $tf.tf_order != $max}
                        <div class="item4_middle">
                            <input type="checkbox" {in name="1" value="$tf.tf_qudao"}checked{/in} disabled name="tf_qudao[]" value="1" /><label>&nbsp; 微信 &nbsp;&nbsp;&nbsp;</label>
                            <input type="checkbox" {in name="2" value="$tf.tf_qudao"}checked{/in} disabled name="tf_qudao[]" value="2" /><label>&nbsp; 朋友圈 &nbsp;&nbsp;&nbsp;</label>
                            <input type="checkbox" {in name="3" value="$tf.tf_qudao"}checked{/in} disabled name="tf_qudao[]" value="3" /><label>&nbsp; QQ &nbsp;&nbsp;&nbsp;</label>
                            <input type="checkbox" {in name="4" value="$tf.tf_qudao"}checked{/in} disabled name="tf_qudao[]" value="4" /><label>&nbsp; 微博 &nbsp;&nbsp;&nbsp;</label>
                        </div>
                        {else /}
                        <div class="item4_middle">
                            <input type="checkbox" {in name="1" value="$tf.tf_qudao"}checked{/in} name="tf_qudao[]" value="1" /><label>&nbsp; 微信 &nbsp;&nbsp;&nbsp;</label>
                            <input type="checkbox" {in name="2" value="$tf.tf_qudao"}checked{/in} name="tf_qudao[]" value="2" /><label>&nbsp; 朋友圈 &nbsp;&nbsp;&nbsp;</label>
                            <input type="checkbox" {in name="3" value="$tf.tf_qudao"}checked{/in} name="tf_qudao[]" value="3" /><label>&nbsp; QQ &nbsp;&nbsp;&nbsp;</label>
                            <input type="checkbox" {in name="4" value="$tf.tf_qudao"}checked{/in} name="tf_qudao[]" value="4" /><label>&nbsp; 微博 &nbsp;&nbsp;&nbsp;</label>
                        </div>
                        {/if}

                    </div>
                </div>
                {/volist}
            </div>
            <div class="add_5" data-margin="<?php echo 55+($max-1)*210; ?>" onclick="intoHTML(this);" style="width: 100px;height: 100px;float: left;margin-top: 55px;background-image: url('__IMG__/addpic.png');background-size: 100px 100px;"></div>
            <div style="clear: both"></div>
            <!--曝光率和到达率的二期新增  end -->
            <!--曝光率和到达率的二期新增  end -->
            <!--曝光率和到达率的二期新增  end -->
            <!---->
                    {/if}
                {/if}
                <!--曝光率和到达率的二期新增  end -->
            {/if}
            <div class="item4" style="padding-top:15px;">
                <div class="item4_left">
                    任务区域
                </div>
                <div class="item4_middle">
                    <div class="select" id="sheng">
                        <div class="option task_sheng">
                            {$data.task_sheng}
                        </div>
                        <div class="sanjiao_wrap">

                            <img class="sanjiao2" src="__IMG__/select.png" id="sanjiao2">
                        </div>


                    </div>
                    <div class="select" id="shi">
                        <div class="option task_shi">
                            {$data.task_shi}
                        </div>
                        <div class="sanjiao_wrap">
                            <img class="sanjiao2" src="__IMG__/select.png" id="sanjiao3">
                        </div>
                    </div>
                    <div class="select" id="qu">
                        <div class="option task_qu" style="overflow: hidden;padding-right: 30px">
                            {$data.task_qu}
                        </div>
                        <div class="sanjiao_wrap">
                            <img class="sanjiao2" src="__IMG__/select.png" id="sanjiao4">
                        </div>
                    </div>
                </div>
            </div>
            <div class="item4">
                <div class="item4_left">
                    任务总数
                </div>
                <div class="item4_middle">
                    <input class="inputrenwu" name="task_num" id="task_num" type="text" oninput = "handleMoney(this,0);" value="{$data.task_num}" style="width:160px;">
                    <div class="danwei">/个</div>
                </div>
            </div>
            <div class="item4">
                <div class="item4_left">
                    单个任务金额
                </div>
                <div class="item4_middle">
                    <input class="inputrenwu" name="task_price" id="task_price" type="text" readonly value="{$data.task_price}" style="width:160px;">
                    <div class="danwei">/平台币
                        <span style="margin-left:20px;">任务金额
                   </span>
                    </div>
                    <div class="text">注：1元=10平台币
                    </div>


                </div>
            </div>
            <div class="item4" style="padding-top:15px;">
                <div class="item4_left">
                    任务总金额

                </div>
                <div class="item4_middle">
                    <input class="inputrenwu" type="text" name="money" id="money" readonly value="{$data.task_money}" style="width:160px;">
                    <div class="danwei">/平台币

                    </div>

                </div>
            </div>
            <div class="item4">
                <div class="item4_left">
                    任务名称

                </div>
                <div class="item4_middle">
                    <input class="inputrenwu" name="task_name" type="text" value="{$data.task_name}">
                </div>
            </div>
            <div class="item4" style="height:auto;">
                <div class="item4_left">
                    任务图片
                </div>
                <input type="file" accept="image/*" id="fileimg" onChange="previewimg(this)" style="display:none;" name ="input_image" >
                <div class="item4_middle"  id="uploader"><!--如果不加这个id=uploader下面的王编辑器加载不出来。。。-->
                    <div class="add uploadimg">
                        <img src="__IMG__/addpic.png" alt="">
                    </div>
                    <div class="add imgshow">
                        <img id="imgsrc" src="{$data.task_image}" alt="">
                        <div class="delete" onclick="delimg();">
                            删除
                        </div>
                    </div>
                </div>
            </div>
            <div class="item4">
                <div class="item4_left">
                    起止时间
                </div>
                <div class="item4_middle">
                    <div class="startime">
                        <input style="border: none" type="text" name="task_starttime" value="{$data.task_starttime|substr=0,16}" class="startime_text {if $data.task_share_d_fen==2}test_item{/if}" readonly />
                    </div>
                    <div>至</div>
                    <div class="startime" style="margin-left:10px;">
                        <input style="border: none" type="text" class="startime_text {if $data.task_share_d_fen==2}test_item{/if}" name="task_endtime" value="{$data.task_endtime|substr=0,16}" readonly />
                    </div>
                </div>
            </div>
            <div class="item4" style="height:auto;">
                <div class="item4_left">
                    任务简介

                </div>
                <div id="LAY_editor" style="width:750px;">
                    <p>{$data.task_content}</p>
                </div>
            </div>
            <div class="item4" style="height:auto;">
                <div class="item4_left">

                </div>
                <div style="width: 750px;height: 20px;line-height: 20px;margin-top: -30px;color: gray;font-size: 13px;">
                    注：分享任务内容插入链接需点击编辑器 <img src="__IMG__/href.png" height="17"> 图标进行插入，建议插入链接名称和链接一致
                </div>
            </div>
            {if $data.task_type == 6}
            <!--start-->
            <!--分享途径选择 start -->
            {if $data.task_share_type != 2 || $data.task_share_d_fen != 2}
            <div class="item4">
                <div class="item4_left">
                    分享渠道
                </div>
                <div class="item4_middle">
                    <input type="checkbox" id="qqqddd1" name="task_share_qudao[]" {if $data['task_share_qudao'] && in_array(1,$data['task_share_qudao'])}checked{/if} value="1" /><label for="qqqddd1">&nbsp; 微信 &nbsp;&nbsp;&nbsp;</label>
                    <input type="checkbox" id="qqqddd2" name="task_share_qudao[]" {if $data['task_share_qudao'] && in_array(2,$data['task_share_qudao'])}checked{/if} value="2" /><label for="qqqddd2">&nbsp; 朋友圈 &nbsp;&nbsp;&nbsp;</label>
                    <input type="checkbox" id="qqqddd3" name="task_share_qudao[]" {if $data['task_share_qudao'] && in_array(3,$data['task_share_qudao'])}checked{/if} value="3" /><label for="qqqddd3">&nbsp; QQ &nbsp;&nbsp;&nbsp;</label>
                    <input type="checkbox" id="qqqddd4" name="task_share_qudao[]" {if $data['task_share_qudao'] && in_array(4,$data['task_share_qudao'])}checked{/if} value="4" /><label for="qqqddd4">&nbsp; 微博 &nbsp;&nbsp;&nbsp;</label>
                </div>
            </div>
            {else /}
            <input type="checkbox" checked name="task_share_qudao[]" value="4" class="hidden" />
            {/if}
            <!--分享途径选择  end -->
            <div class="item4 aaa_type">
                <div class="item4_left">
                    分享内容类型
                </div>
                <div class="item4_middle">
                    <div class="lable" onclick="choosetype2(0)">
                        <span class="span11 {if $data.task_share_content_type==1}hidden{/if}"></span>
                        <img src="__IMG__/radio.png" class="radioched2 {if $data.task_share_content_type!=1}hidden{/if}"> 编辑器

                    </div>
                    <div class="lable" onclick="choosetype2(1)">
                        <img src="__IMG__/radio.png" class="radioched2 {if $data.task_share_content_type!=2}hidden{/if}">
                        <span class="span11 {if $data.task_share_content_type==2}hidden{/if}"></span> 链接
                    </div>
                    <div class="lable" onclick="choosetype2(2)">
                        <img src="__IMG__/radio.png" class="radioched2 {if $data.task_share_content_type!=3}hidden{/if}">
                        <span class="span11 {if $data.task_share_content_type==3}hidden{/if}"></span> 图片
                    </div>
                </div>
            </div>
            <div class="item4 sharepic {if $data.task_share_content_type!=3}hidden{/if}" style="height:auto;">
                <div class="item4_left">
                    分享的图片
                </div>
                <input type="file" accept="image/*" id="fileimg2" onChange="previewimg22(this)" style="display:none;" name ="input_image22" >
                <div class="item4_middle"  id="uploader2"><!--如果不加这个id=uploader下面的王编辑器加载不出来。。。-->
                    <div class="add uploadimg2">
                        <img src="__IMG__/addpic.png" alt="">
                    </div>
                    <div class="add imgshow2 {if $data.task_share_content_type!=3}hidden{/if}">
                        <img id="imgsrc2" src="{$data.task_share_wechatpic_old}" alt="">
                        <div class="delete" onclick="delimg22();">
                            删除
                        </div>
                    </div>
                </div>
            </div>
            <div class="item4 aaa_href {if $data.task_share_content_type!=2}hidden{/if}">
                <div class="item4_left">
                    分享链接
                </div>
                <div class="item4_middle">
                    <input class="inputrenwu" name="task_share_href" type="text" placeholder="请输入分享链接" value="{$data.task_share_href}">
                </div>
            </div>
            <!--end-->
            <div class="item4 {if $data.task_share_content_type!=1}hidden{/if}" style="height:auto;margin-bottom:0;" id="forshare">
                <div class="item4_left">
                    任务内容
                </div>
                <div id="LAY_editor2" style="width:750px;">
                    <p>{$data.task_share_content}</p>
                </div>
            </div>
            {/if}
            <div class="item4" style="height:34px;padding:40px 0;margin-bottom:0;">
                <div class="item4_left">

                </div>
                <div class="item4_middle">
                    <div class="btn1">
                        立即修改

                    </div>
                    <div class="btn2" onclick="history.go(-1)">
                        取消
                    </div>
                </div>
            </div>

        </div>
        <input type="hidden" name="task_type" id="task_type" value="{$data.task_type}" />
        <input type="hidden" name="task_share_type" id="task_share_type" value="{$data.task_share_type}" />
        <input type="hidden" name="task_image" id="task_image" value="{$data.task_image}" /><!--为1没传图  为2已传图-->
        <input type="hidden" name="task_image2" id="task_image2" value="{$data.task_share_wechatpic_old}" /><!--为1没传图  为2已传图-->
        <input type="hidden" name="task_video" id="task_video" value="{$data.task_href}" /><!--为1没传图  为2已传图-->
        <input type="hidden" name="task_get_num" id="task_get_num" value="{$data.task_get_num}" /><!--已经领取了多少了-->
        <input type="hidden" name="task_num_before" value="{$data.task_num}" /><!--记录一下以前的数量-->
        <input type="hidden" name="task_id" value="{$data.task_id}" />
        <input type="hidden" name="task_share_content_type" id="task_share_content_type" value="{$data.task_share_content_type}" />
        <!--防止重复提交-->
        <input type="hidden" name="repeatSubmit" id="repeatSubmit" value="1" />
        <!--<input type="submit" value="上传文件">-->
        <!--防止重复提交-->
        <input type="hidden" name="task_active" id="task_active" value="{$data.task_active}" />
        <!--<input type="submit" value="上传文件">-->
    </form>
</div>
</div>
<div class="erqifen_edit hidden">
    <div class="five" id="five_1">
        <div class="item4">
            <div class="item4_left">
                本步骤描述
            </div>
            <div class="item4_middle">
                <input class="inputrenwu" maxlength="15" name="tf_desc" type="text" placeholder="步骤简短描述（15个字）" style="width: 300px;">
                <div onclick="shanchu(this);" class="five_1" style="display:none;margin-left: 100px;margin-top: -15px;border: 1px solid red;padding: 2px;height: 20px;line-height: 20px;border-radius: 2px;color: red;">删除</div>
            </div>
        </div>
        <!--是否需要审核-->
        <div class="item4">
            <div class="item4_left">
                是否上传图
            </div>
            <div class="item4_middle">
                <div class="lable">
                    <input type="radio" name="tf_submit" value="1" checked> <span>是</span>
                </div>
                <div class="lable">
                    <input type="radio" name="tf_submit" value="2"> <span>否</span>
                </div>
            </div>
        </div>
        <!--当前步骤任务金额-->
        <div class="item4">
            <div class="item4_left">
                当前步骤任务金额
            </div>
            <div class="item4_middle">
                <input class="inputrenwu" name="tf_money" type="text" oninput = "handleMoney(this,1);" placeholder="最多保留一位小数" style="width:160px;">
                <div class="danwei">/平台币

                </div>
                <div class="text">注：1元=10平台币
                </div>


            </div>
        </div>
        <!--分享途径选择 start -->
        <div class="item4" style="padding-top: 15px;margin-bottom: 20px;">
            <div class="item4_left">
                分享渠道
            </div>
            <div class="item4_middle">
                <input type="checkbox" name="tf_qudao[]" value="1" /><label>&nbsp; 微信 &nbsp;&nbsp;&nbsp;</label>
                <input type="checkbox" name="tf_qudao[]" value="2" /><label>&nbsp; 朋友圈 &nbsp;&nbsp;&nbsp;</label>
                <input type="checkbox" name="tf_qudao[]" value="3" /><label>&nbsp; QQ &nbsp;&nbsp;&nbsp;</label>
                <input type="checkbox" name="tf_qudao[]" value="4" /><label>&nbsp; 微博 &nbsp;&nbsp;&nbsp;</label>
            </div>
        </div>
    </div>
</div>
</body>
{include file="public/footer"}
<script type="text/javascript" src="__JSS__/plugins/layui/layui.all.js"></script>
<script type="text/javascript" src="__JS__/wk.js"></script>
<script type="text/javascript" src="__JS__/webuploader/webuploader.js"></script>
<script src="__JSS__/plugins/wangEditor-3.1.1/release/wangEditor.js" ></script>
<script src="__SCRIPT__/common.js" ></script>
<script>
    //    var n = wk.uploads({num:3,type:'jpg,jpeg,png',url:"{:url('shop/upload/uploadLocality')}"});
    //    function imgDel(e,obj){
    //        wk.uploads_del(e,obj,n,"{:url('shop/upload/deleteLocality')}");
    //    }
    var editor = wk.wang({elem:'#LAY_editor',url:"{:url('shop/upload/wangUpload')}"});
    var editor2 = wk.wang({elem:'#LAY_editor2',url:"{:url('shop/upload/wangUpload')}"});
</script>
<script type="text/javascript">
    function isfenshare() { //?????????????????为什么要放到最上面？？？？？？？？？？？？？
        var _aa = $('#task_type').val();
        if(_aa == 6){
            var _bb = $('#task_share_type').val();
            if(_bb == 2){
                var _cc = $('input[name="task_share_d_fen"]:checked').val();
                if(_cc == 2){
                    return 1;
                }
            }
        }
        return 0;
    }
    layui.use('laydate', function () {
        var laydate = layui.laydate;
        //同时绑定多个
        lay('.test_item').each(function(){
            laydate.render({
                elem: this
                ,format:'yyyy-MM-dd HH:mm'
                ,type:'datetime'
                ,trigger: 'click'
            });
        });
    });
    $('.upload').click(function () {
        $('.havevideo').text('上传中，请稍后...');
        $('#file').click();
    });
    $('.uploadimg').click(function () {
        $('#fileimg').click();
    });
    $('.uploadimg2').click(function () {
        $('#fileimg2').click();
    });
    function preview(obj){

        uploadVideoCommon('fabutask','task_video');
//        $('.havevideo').text(obj.files[0]['name']);
        $('#showvideo').css('display','none');

    }
    function previewimg(obj){
        var src = window.URL.createObjectURL(obj.files[0]);
        $('#imgsrc').attr('src',src);
        $('.imgshow').removeClass('hidden');
        uploadImageCommon('fabutask','task_image',0);
    }
    function previewimg22(obj){
        var src = window.URL.createObjectURL(obj.files[0]);
        $('#imgsrc2').attr('src',src);
        $('.imgshow2').removeClass('hidden');
        uploadImageCommon('fabutask','task_image2',1);
    }
    function delimg(){
        $('.imgshow').addClass('hidden');
        $('#task_image').val('');
    }
    function delimg22(){
        $('.imgshow2').addClass('hidden');
        $('#task_image2').val('');
    }
    $('.btn1').click(function () {
        var repeatSubmit = $('#repeatSubmit').val();
        if(repeatSubmit == 2){
            alert('请勿重复提交！');
            return false;
        }else{
            var submitInfo = formCheck();
            if(submitInfo.status == 200){
//
                var up_task_fen = '';
                var need2 = isfenshare();
                if(need2 == 1){
                    for(var indexx in form_data) {
                        up_task_fen += form_data[indexx] + '|';
                    }
                }

//
                var first = $('#task_active').val();
                if(first == 2){
                    tijiaoend(1,up_task_fen);
                }else{
                    var content1 = $('input[name="task_name"]').val();
                    var content2 = editor.txt.html();
                    var content3 = '';
                    if(submitInfo.special == 2){
                        content3 = editor2.txt.html();
                    }
                    $.ajax({
                        url: '/shop/Task/sensitive',
                        data: 'content1='+content1+'&content2='+content2+'&content3='+content3,
                        type: 'POST',
                        dataType: 'JSON',
                        success: function (returnmingan) {
                            if(returnmingan.status == 200){
                                tijiaoend(0,up_task_fen);
                            }else{
                                if(confirm(returnmingan.msg)){
                                    tijiaoend(1,up_task_fen);
                                }
                            }
                        },
                        error: function () {
                            alert('服务器错误，请刷新重试！');
                        }
                    })
                }
            }else{
                alert(submitInfo.msg);
                return false;
            }
        }
    });
    function tijiaoend(mingantype,up_task_fen) {
        $('#repeatSubmit').val(2);
        var formData = $( "#fabutask" ).serialize();
        var task_content = editor.txt.html();
        var task_share_content = editor2.txt.html();
        formData += '&task_content='+task_content+'&task_share_content='+task_share_content+'&up_task_fen='+up_task_fen+'&mingantype='+mingantype;
        $.ajax({
            url: '/shop/Task/editTask',
            data: formData,
            type: 'POST',
            dataType: 'JSON',
            success: function (returnData) {
                alert(returnData.msg);
                if(returnData.status == 200){
                    window.location.href = '/shop/Task/homePage';
                    return true;
                }else{
                    $('#repeatSubmit').val(1);
                }
            },
            error: function () {
                alert('服务器错误，请刷新重试！');
            }
        })
    }
</script>

<script>
    function choosetype2(index) {
//
        if(index == 0){
            $('#forshare').removeClass('hidden');
            $('.aaa_href').addClass('hidden');
            $('.sharepic').addClass('hidden');
        }else if(index == 1){
            $('.aaa_href').removeClass('hidden');
            $('#forshare').addClass('hidden');
            $('.sharepic').addClass('hidden');
        }else{
            $('.aaa_href').addClass('hidden');
            $('#forshare').addClass('hidden');
            $('.sharepic').removeClass('hidden');

        }
//
        var span1 = document.getElementsByClassName('span11');
        var radioched = document.getElementsByClassName('radioched2');
        for (var i = 0; i < span1.length; i++) {
            span1[i].className = 'span11';
            radioched[i].className = 'radioched2 hidden';

        }
        span1[index].className = 'span11 hidden';
        radioched[index].className = 'radioched2';
        $('#task_share_content_type').val(index+1);
    }
    function formCheck() {
        var need = isfenshare();
        if(need == 1){
            var befroe = add5status();
            if(befroe.status != 200){
                return befroe;
            }
        }
        var res = {
            'status':'200',
            'special':'1',
            'msg':'OK'
        };
        var task_type = $('input[name="task_type"]').val();
        var task_href = $('input[name="task_href"]').val();
        var task_href_ios = $('input[name="task_href_ios"]').val();
        var task_app_ios = $('input[name="task_app_ios"]').val();
        var task_app_android = $('input[name="task_app_android"]').val();
        var task_num = $('input[name="task_num"]').val();
        var task_image = $('input[name="task_image"]').val();
        //分享图片
        var task_image2 = $('input[name="task_image2"]').val();
        //
        var task_video = $('input[name="task_video"]').val();
        var task_name = $('input[name="task_name"]').val();
        var task_content = editor.txt.html();
        var task_share_content = editor2.txt.html();
        if(!task_type){
            res.status = 0;
            res.msg = '任务类型不能为空';
            return res;
        }
        if(task_type != 5 && task_type != 6){
            if(!task_href){
                res.status = 0;
                res.msg = '任务链接不能为空';
                return res;
            }
        }
        if(task_type == 5){
            if(!task_video){
                res.status = 0;
                res.msg = '任务视频不能为空';
                return res;
            }
        }
        if(task_type == 6){
            var task_share_content_type = $('input[name="task_share_content_type"]').val();
            var task_share_href = $('input[name="task_share_href"]').val().trim();
            if(task_share_content_type == 1){
                if(task_share_content == '<p><br></p>' || task_share_content == '<p></p><p><br></p>'){
                    res.status = 0;
                    res.msg = '分享任务的内容不能为空';
                    return res;
                }
                res.special = 2;
            }else if(task_share_content_type == 2){
                if(task_share_href == ''){
                    res.status = 0;
                    res.msg = '分享任务的分享链接不能为空';
                    return res;
                }
            }else{
                if(!task_image2){
                    res.status = 0;
                    res.msg = '分享任务的分享图片不能为空';
                    return res;
                }
            }
            //分享渠道
            var qudao = $('input[name="task_share_qudao[]"]:checked').val();
            if(qudao == 'undefined' || !qudao){
                res.status = 0;
                res.msg = '分享任务的分享渠道不能为空';
                return res;
            }
        }
        if (task_type == 1) {
            if (!task_href_ios || !task_app_ios || !task_app_android) {
                res.status = 0;
                res.msg = '任务各下载链接不能为空';
                return res;
            }
        }
        if (!task_num) {
            res.status = 0;
            res.msg = '任务数量不能为空';
            return res;
        }else{
            var task_get_num = $('input[name="task_get_num"]').val();
            if(parseInt(task_num) <= parseInt(task_get_num)){
                res.status = 0;
                res.msg = '任务数量要多于已领取数量，当前已领取：'+task_get_num;
                return res;
            }
        }
        if(!task_name){
            res.status = 0;
            res.msg = '任务名称不能为空';
            return res;
        }
        if(!task_image){
            res.status = 0;
            res.msg = '任务图片不能为空';
            return res;
        }
        if(task_content == '<p><br></p>' || task_content == '<p></p><p><br></p>'){
            res.status = 0;
            res.msg = '任务简介不能为空';
            return res;
        }
        return res;
    }
    function handleMoney(obj,type){
        if(type == 0){
            obj.value = obj.value.replace(/[^\d]/g, '');
            obj.value = obj.value.replace(/\.{2,}/g, '.');
            obj.value = obj.value.replace('.', '$#$').replace(/\./g, '').replace('$#$', '.');
            obj.value = obj.value.replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3');
            if (obj.value.indexOf('.') < 0 && obj.value != '') {
                obj.value = parseFloat(obj.value);
            }
            if ((obj.value.length == 1 && obj.value == '.') || obj.value.substring(0,1) == '.') {
                obj.value = '';
            }
        }else{
            obj.value = obj.value.replace(/[^\d.]/g, '');
            obj.value = obj.value.replace(/\.{2,}/g, '.');
            obj.value = obj.value.replace('.', '$#$').replace(/\./g, '').replace('$#$', '.');
//            obj.value = obj.value.replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3');
            obj.value = obj.value.replace(/^(\-)*(\d+)\.(\d).*$/, '$1$2.$3'); //只能输入1个小数
            if (obj.value.indexOf('.') < 0 && obj.value != '') {
                obj.value = parseFloat(obj.value);
            }
            if ((obj.value.length == 1 && obj.value == '.') || obj.value.substring(0,1) == '.') {
                obj.value = '';
            }
        }
        var value1 = $('#task_num').val();
        var value2 = $('#task_price').val();
        if(value1 && value2){
            var res = value1*value2;
            $('#money').val(res.toFixed(1));
        }else{
            $('#money').val(0);
        }
    }
</script>
<script>
    var _a = $('#task_type').val();
    if(_a == 6){
        var _b = $('#task_share_type').val();
        if(_b == 2){
            var _c = $('input[name="task_share_d_fen"]:checked').val();
            if(_c == 2){
                var margin = $('.add_5').attr('data-margin');
                $('.add_5').css('margin-top',margin+'px');
                var form_data = new Array();
                var arr = {$form_data};
                for(var index in arr) {
                    form_data[index] = arr[index];
                }
                var _html = $('.erqifen_edit').html();
                $('.erqifen_edit').remove();
            }
        }

    }

    function intoHTML(el) {
        //0、先判断当前填写是否正确
        var res = add5status();
        if(res.status != 200){
            alert(res.msg);
            return false;
        }else{
            //1、先高度
            var margin = $(el).attr('data-margin');
            $(el).attr('data-margin',margin-0+210);
            $(el).css('margin-top',margin-0+210+'px');
            //2、获取最新的一步的id
            var ji = $('.five').length;
            var now = $('.five')[ji-1].id;
            var arr = now.split('_');
            //3、把删除按钮漏出来
            $('#'+now+' .five_'+arr[1]).css('display','block');
            //4、填完的不能改了
            $('.five input[name="tf_submit"]:checked').siblings('span').css('color','blue');
            $('.five input[name="tf_submit"]').css('display','none');
            $('.five input').prop('disabled',true);
            //5、塞HTML
            $('.erqifen').append(_html);
            //6、改最新的div的id
            var ji = $('.five').length;
            $('.five')[ji-1].id = 'five_'+(arr[1]-0+1);
            //7、把删除按钮的class调整到和div的id一致
            $('#'+'five_'+(arr[1]-0+1)+' .five_1').addClass('five_'+(arr[1]-0+1));
            $('#'+'five_'+(arr[1]-0+1)+' .five_1').removeClass('five_1');

            if($('.five').length >= 5){
                $('.add_5').addClass('hidden');
            }else{
                $('.add_5').removeClass('hidden');
            }
        }
        gaizi();
    }
    function add5status() {
        var res = {
            'status':'200',
            'special':'1',
            'msg':'OK'
        };
        var ji = $('.five').length;
        var now = $('.five')[ji-1].id;

        var tf_desc = $('#'+now+' input[name="tf_desc"]').val().trim();
        var tf_submit = $('#'+now+' input[name="tf_submit"]:checked').val();
        var tf_money = $('#'+now+' input[name="tf_money"]').val();
        var tf_qudao = '';
        $('#'+now+' input[name="tf_qudao[]"]:checked').each(function (i,d) {
            tf_qudao += d.value+',';
        });
        if(tf_desc == ''){
            res.status = 0;
            res.msg = '描述不能为空';
            return res;
        }
        if(tf_money == '' || tf_money <= 0){
            res.status = 0;
            res.msg = '任务金额不能为空';
            return res;
        }
        if(tf_qudao == ''){
            res.status = 0;
            res.msg = '分享渠道不能为空';
            return res;
        }
        tf_qudao = tf_qudao.substring(0,tf_qudao.length-1);
        form_data[now] = tf_desc + '_' + tf_submit + '_' + tf_money + '_' + tf_qudao;
        return res;
    }
    function shanchu(el) {
        var nowid = $(el).attr('class');
        var arr = form_data;
        for(var index in arr) {
            form_data = new Array();
            if(index != nowid){
                form_data[index] = arr[index];
            }
        }
        $('#'+nowid).remove();
        //调整高度
        var margin = $('.add_5').attr('data-margin');
        $('.add_5').attr('data-margin',margin-210);
        $('.add_5').css('margin-top',margin-210+'px');
        if($('.five').length >= 5){
            $('.add_5').addClass('hidden');
        }else{
            $('.add_5').removeClass('hidden');
        }
        gaizi();
    }
    function gaizi() {
        //--改字
        $('.five').each(function (iii,ddd) {
            var iiiddd = $(ddd).attr('id');
            $('#'+iiiddd+' .item4_left').eq(0).text('第 '+(iii-0+1)+' 步描述');
        });
        //--改字
    }
</script>